<template>
  <el-dialog append-to-body class="common_dialog_in" custom-class="reset-dialog-width" :visible.sync="visible" title="选择二维码组" :close-on-click-modal="false" :close-on-press-escape="false">
    <!-- <GoodList v-if="visible" ref="GoodListItem" :searchItem="true" :listBorder="true" :chooseTable="true"></GoodList> -->
    <grouptList v-if="visible" :rowId="rowId" ref="groupListItem" :getType="getType" :listBorder="true" :chooseTable="true" @formSubmitHandle="formSubmitHandle"></grouptList>
    <!-- <template slot="footer">
      <el-button :loading="confirmLoading" type="primary" @click="formSubmitHandle()">确 定</el-button>
      <el-button @click="visible = false">取 消</el-button>
    </template> -->
  </el-dialog>
</template>

<script>
import debounce from 'lodash/debounce'
import GrouptList from '../grouptList.vue'  //商品列表组件
export default {
  data() {
    return {
      visible: false,
      confirmLoading: false,
      rowId: ''
    }
  },
  props: {
    // getType      类型
    getType: {
      type: String,
      default: ''
    },
  },
  components: {
    GrouptList, //列表组件
  },
  methods: {
    init() {
      this.visible = true
      this.$nextTick(() => {
        this.confirmLoading = false
      })
    },
    // 表单提交
    formSubmitHandle(value) {
      this.confirmLoading = true
      this.$emit('getValue', value, this.rowId)
      this.visible = false
      this.confirmLoading = false
    }

  }
}
</script>
<style lang="scss" scoped>
.common_dialog_in {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  ::v-deep.el-dialog {
    margin: 0 auto !important;
    max-height: 1000px;

    .el-dialog__body {
      overflow: hidden;
      overflow-y: auto;
      max-height: 800px;
    }
  }
}
</style>
